package section_05.anonymousInnerClass;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Random;

import section_04.genericsMethods.Generators;

public class BankTeller {
	public static void serve(Teller t, Customer c) {
		System.out.println(t + " serves " + c);
	}

	public static void main(String[] args) {
		Random rand = new Random(47);
		Queue<Customer> line = new LinkedList<>();
		Generators.fill(line, Customer.generator(), 15);
		List<Teller> tellers = new ArrayList<>();
		Generators.fill(tellers, Teller.generator, 4);
		for (Customer c : line)
			serve(tellers.get(rand.nextInt(tellers.size())), c);

	}
}
